<template>
  <div>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
      <el-form-item label="餐厅ID" prop="mobile">
        <el-input v-model="formData.mobile" placeholder="请输入餐厅ID" :maxlength="11" show-word-limit clearable
          prefix-icon='el-icon-s-shop' :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="餐厅地址" prop="field101">
        <el-input v-model="formData.field101" placeholder="请输入餐厅地址" :maxlength="20" clearable
          prefix-icon='el-icon-position' :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="每日开店" prop="field102">
        <el-time-picker v-model="formData.field102" format="HH:mm:ss" value-format="HH:mm:ss"
          :picker-options='{"selectableRange":"00:00:00-23:59:59"}' :style="{width: '100%'}"
          placeholder="请选择每日开店" clearable></el-time-picker>
      </el-form-item>
      <el-form-item label="每日闭店" prop="field103">
        <el-time-picker v-model="formData.field103" format="HH:mm:ss" value-format="HH:mm:ss"
          :picker-options='{"selectableRange":"00:00:00-23:59:59"}' :style="{width: '100%'}"
          placeholder="请选择每日闭店" clearable></el-time-picker>
      </el-form-item>
      <el-form-item label="联系电话" prop="field104">
        <el-input v-model="formData.field104" placeholder="请输入联系电话" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="空闲餐桌数" prop="field105">
        <el-input v-model="formData.field105" placeholder="请输入空闲餐桌数" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="密码修改" prop="field108">
        <el-button type="primary" icon="el-icon-search" size="medium"> 主要按钮 </el-button>
      </el-form-item>
      <el-form-item label="修改" prop="field106">
        <el-button type="primary" icon="el-icon-search" size="medium"> 主要按钮 </el-button>
      </el-form-item>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        mobile: '',
        field101: undefined,
        field102: '08:00:00',
        field103: '19:30:00',
        field104: undefined,
        field105: undefined,
        field108: undefined,
        field106: '',
      },
      rules: {
        mobile: [{
          required: true,
          message: '请输入餐厅ID',
          trigger: 'blur'
        }, {
          pattern: /^1(3|4|5|7|8|9)\d{9}$/,
          message: '手机号格式错误',
          trigger: 'blur'
        }],
        field101: [{
          required: true,
          message: '请输入餐厅地址',
          trigger: 'blur'
        }],
        field102: [{
          required: true,
          message: '请选择每日开店',
          trigger: 'change'
        }],
        field103: [{
          required: true,
          message: '请选择每日闭店',
          trigger: 'change'
        }],
        field104: [{
          required: true,
          message: '请输入联系电话',
          trigger: 'blur'
        }, {
          pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
          message: '手机号格式不对',
          trigger: 'blur'
        }],
        field105: [{
          required: true,
          message: '请输入空闲餐桌数',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
